
const toStar = (str,reserveStartNumber = 0,reserveEndNumber = 0) => {

	if(!str) return '--'
	let starLength = str.length - (reserveStartNumber + reserveEndNumber)
	let starStr = ''
	let startStr = ''
	let endStr = ''

	for (let i = 0; i < starLength; i++) {
		starStr = starStr + '*'
	}
	startStr = str.substr(0,reserveStartNumber) 
	if(reserveEndNumber == 0){
		endStr = ''
	}
	else{
		endStr = str.substr(-reserveEndNumber)
	}
	let returnStr = startStr + starStr + endStr

	return returnStr
}

export default toStar
